package persistencia;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author abacrazy
 */
public class BDUtil {

    public final static String DRIVER = "org.postgresql.Driver";
    public final static String URL = "jdbc:postgresql://localhost:5432/ponto";
    public final static String USUARIO = "administrador";
    public final static String SENHA = "123456";
    public static Connection conexao;

    public final static Connection getConexao() throws SQLException {
        if (conexao == null) {
            try {
                Class.forName(DRIVER);
                conexao = DriverManager.getConnection(URL, USUARIO, SENHA);
            } catch (ClassNotFoundException ex) {
                ex.printStackTrace();
            }

        }
        return conexao;
    }
}
